package com.szq.pattern.impl;

import com.szq.pattern.Expression;

/**
 * @description:
 * @author: szq
 * @date: 2021-09-15 08:17:34
 */
public class AndExpression implements Expression {

    Expression expression1;
    Expression expression2;

    public AndExpression(Expression expression1, Expression expression2) {
        this.expression1 = expression1;
        this.expression2 = expression2;
    }

    @Override
    public boolean interpreter(String con) {
        return expression1.interpreter(con) && expression2.interpreter(con);
    }
}
